.class public Lcom/nemustech/regina/ReginaCheckForUpdate;
.super Landroid/app/ListActivity;
.source "ReginaCheckForUpdate.java"


# static fields
.field static final NOT_INSTALLED_YET:I = 0x0

.field protected static final READ_FAIL:I = 0x1

.field protected static final READ_SUCCESS:I = 0x0

.field private static final SELECTED_ONE_ITEM:I = 0x0

.field private static final TAG:Ljava/lang/String; = "ReginaCheckForUpdate"


# instance fields
.field protected hViewSwitcher:Landroid/os/Handler;

.field private mAppUpdatedReceiver:Landroid/content/BroadcastReceiver;

.field private mCancelReceiver:Landroid/content/BroadcastReceiver;

.field private mDeveloperMode:Z

.field private mIsLog:Z

.field private mIsTarget:Z

.field private mList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/nemustech/regina/XMLRecord;",
            ">;"
        }
    .end annotation
.end field

.field private mListAdapter:Lcom/nemustech/regina/XMLRecordAdapter;

.field private mNetworkInfoReceiver:Landroid/content/BroadcastReceiver;

.field private mReadXMLResult:I

.field private mSelectedPostion:I

.field private mWarn3gCharge:Ljava/lang/String;

.field private updateAllListener:Landroid/view/View$OnClickListener;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 39
    invoke-direct {p0}, Landroid/app/ListActivity;-><init>()V

    .line 56
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsLog:Z

    .line 57
    new-instance v0, Lcom/nemustech/regina/ReginaCheckForUpdate$1;

    invoke-direct {v0, p0}, Lcom/nemustech/regina/ReginaCheckForUpdate$1;-><init>(Lcom/nemustech/regina/ReginaCheckForUpdate;)V

    iput-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mNetworkInfoReceiver:Landroid/content/BroadcastReceiver;

    .line 76
    new-instance v0, Lcom/nemustech/regina/ReginaCheckForUpdate$2;

    invoke-direct {v0, p0}, Lcom/nemustech/regina/ReginaCheckForUpdate$2;-><init>(Lcom/nemustech/regina/ReginaCheckForUpdate;)V

    iput-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mAppUpdatedReceiver:Landroid/content/BroadcastReceiver;

    .line 107
    new-instance v0, Lcom/nemustech/regina/ReginaCheckForUpdate$3;

    invoke-direct {v0, p0}, Lcom/nemustech/regina/ReginaCheckForUpdate$3;-><init>(Lcom/nemustech/regina/ReginaCheckForUpdate;)V

    iput-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mCancelReceiver:Landroid/content/BroadcastReceiver;

    .line 121
    new-instance v0, Lcom/nemustech/regina/ReginaCheckForUpdate$4;

    invoke-direct {v0, p0}, Lcom/nemustech/regina/ReginaCheckForUpdate$4;-><init>(Lcom/nemustech/regina/ReginaCheckForUpdate;)V

    iput-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->updateAllListener:Landroid/view/View$OnClickListener;

    .line 161
    new-instance v0, Lcom/nemustech/regina/ReginaCheckForUpdate$5;

    invoke-direct {v0, p0}, Lcom/nemustech/regina/ReginaCheckForUpdate$5;-><init>(Lcom/nemustech/regina/ReginaCheckForUpdate;)V

    iput-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->hViewSwitcher:Landroid/os/Handler;

    return-void
.end method

.method static synthetic access$000(Lcom/nemustech/regina/ReginaCheckForUpdate;)Ljava/lang/String;
    .locals 1
    .parameter "x0"

    .prologue
    .line 39
    iget-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mWarn3gCharge:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$002(Lcom/nemustech/regina/ReginaCheckForUpdate;Ljava/lang/String;)Ljava/lang/String;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 39
    iput-object p1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mWarn3gCharge:Ljava/lang/String;

    return-object p1
.end method

.method static synthetic access$100(Lcom/nemustech/regina/ReginaCheckForUpdate;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 39
    iget-boolean v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsLog:Z

    return v0
.end method

.method static synthetic access$200(Lcom/nemustech/regina/ReginaCheckForUpdate;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 39
    iget-boolean v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsTarget:Z

    return v0
.end method

.method static synthetic access$202(Lcom/nemustech/regina/ReginaCheckForUpdate;Z)Z
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 39
    iput-boolean p1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsTarget:Z

    return p1
.end method

.method static synthetic access$300(Lcom/nemustech/regina/ReginaCheckForUpdate;)Lcom/nemustech/regina/XMLRecordAdapter;
    .locals 1
    .parameter "x0"

    .prologue
    .line 39
    iget-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mListAdapter:Lcom/nemustech/regina/XMLRecordAdapter;

    return-object v0
.end method

.method static synthetic access$302(Lcom/nemustech/regina/ReginaCheckForUpdate;Lcom/nemustech/regina/XMLRecordAdapter;)Lcom/nemustech/regina/XMLRecordAdapter;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 39
    iput-object p1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mListAdapter:Lcom/nemustech/regina/XMLRecordAdapter;

    return-object p1
.end method

.method static synthetic access$400(Lcom/nemustech/regina/ReginaCheckForUpdate;)Ljava/util/ArrayList;
    .locals 1
    .parameter "x0"

    .prologue
    .line 39
    iget-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mList:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$402(Lcom/nemustech/regina/ReginaCheckForUpdate;Ljava/util/ArrayList;)Ljava/util/ArrayList;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 39
    iput-object p1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mList:Ljava/util/ArrayList;

    return-object p1
.end method

.method static synthetic access$500(Lcom/nemustech/regina/ReginaCheckForUpdate;)I
    .locals 1
    .parameter "x0"

    .prologue
    .line 39
    iget v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mReadXMLResult:I

    return v0
.end method

.method static synthetic access$502(Lcom/nemustech/regina/ReginaCheckForUpdate;I)I
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 39
    iput p1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mReadXMLResult:I

    return p1
.end method

.method static synthetic access$600(Lcom/nemustech/regina/ReginaCheckForUpdate;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 39
    iget-boolean v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mDeveloperMode:Z

    return v0
.end method


# virtual methods
.method protected findRecordByPackageName(Ljava/lang/String;)Lcom/nemustech/regina/XMLRecord;
    .locals 3
    .parameter "packageName"

    .prologue
    .line 234
    const/4 v1, 0x0

    .line 235
    .local v1, target:Lcom/nemustech/regina/XMLRecord;
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    iget-object v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mList:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-ge v0, v2, :cond_1

    .line 236
    iget-object v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mList:Ljava/util/ArrayList;

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/regina/XMLRecord;

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getPackageName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 237
    iget-object v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mList:Ljava/util/ArrayList;

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    .end local v1           #target:Lcom/nemustech/regina/XMLRecord;
    check-cast v1, Lcom/nemustech/regina/XMLRecord;

    .line 235
    .restart local v1       #target:Lcom/nemustech/regina/XMLRecord;
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 240
    :cond_1
    return-object v1
.end method

.method public getAvailableUpdateItem()I
    .locals 3

    .prologue
    .line 270
    const/4 v0, 0x0

    .line 271
    .local v0, count:I
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    iget-object v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mListAdapter:Lcom/nemustech/regina/XMLRecordAdapter;

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecordAdapter;->getCount()I

    move-result v2

    if-ge v1, v2, :cond_1

    .line 272
    iget-object v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mListAdapter:Lcom/nemustech/regina/XMLRecordAdapter;

    invoke-virtual {v2, v1}, Lcom/nemustech/regina/XMLRecordAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/regina/XMLRecord;

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->canUpdated()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 273
    add-int/lit8 v0, v0, 0x1

    .line 271
    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 276
    :cond_1
    return v0
.end method

.method public getCurrentVersion(Ljava/lang/String;)I
    .locals 4
    .parameter "packageName"

    .prologue
    const/4 v3, 0x0

    .line 261
    :try_start_0
    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v1, p1, v2}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object v1

    iget v1, v1, Landroid/content/pm/PackageInfo;->versionCode:I
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 265
    :goto_0
    return v1

    .line 262
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 264
    .local v0, e:Landroid/content/pm/PackageManager$NameNotFoundException;
    invoke-virtual {v0}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V

    move v1, v3

    .line 265
    goto :goto_0
.end method

.method protected isMediaMounted()Z
    .locals 2

    .prologue
    .line 244
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    .line 245
    .local v0, state:Ljava/lang/String;
    const-string v1, "mounted"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 247
    const/4 v1, 0x1

    .line 254
    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method protected onActivityResult(IILandroid/content/Intent;)V
    .locals 9
    .parameter "requestCode"
    .parameter "resultCode"
    .parameter "data"

    .prologue
    const/4 v8, 0x1

    const/4 v7, 0x0

    .line 306
    iget-boolean v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsTarget:Z

    if-eqz v4, :cond_3

    iget-boolean v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mDeveloperMode:Z

    if-eqz v4, :cond_3

    .line 307
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mList:Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v4

    if-ge v1, v4, :cond_2

    .line 309
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mList:Ljava/util/ArrayList;

    invoke-virtual {v4, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/regina/XMLRecord;

    .line 310
    .local v2, record:Lcom/nemustech/regina/XMLRecord;
    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->isTargeted()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 311
    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getServerVersionCode()I

    move-result v3

    .line 312
    .local v3, serverVersionCode:I
    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getPackageName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0, v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getCurrentVersion(Ljava/lang/String;)I

    move-result v0

    .line 313
    .local v0, currentVersionCode:I
    invoke-virtual {v2, v7}, Lcom/nemustech/regina/XMLRecord;->setTargeted(Z)V

    .line 315
    if-ne v3, v0, :cond_1

    .line 316
    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getCurrentVersionCode()I

    move-result v4

    packed-switch v4, :pswitch_data_0

    .line 322
    const-string v4, "ReginaCheckForUpdate"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " was updated successfully"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    iget-boolean v6, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsLog:Z

    invoke-static {v4, v5, v6}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 323
    const v4, 0x7f070070

    invoke-virtual {p0, v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v4

    new-array v5, v8, [Ljava/lang/Object;

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v7

    invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-static {p0, v4}, Lcom/nemustech/regina/RUtils;->showToast(Landroid/content/Context;Ljava/lang/String;)Landroid/widget/Toast;

    .line 326
    :goto_1
    invoke-virtual {v2, v0}, Lcom/nemustech/regina/XMLRecord;->setCurrentVersion(I)V

    .line 307
    .end local v0           #currentVersionCode:I
    .end local v3           #serverVersionCode:I
    :cond_0
    :goto_2
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 318
    .restart local v0       #currentVersionCode:I
    .restart local v3       #serverVersionCode:I
    :pswitch_0
    const-string v4, "ReginaCheckForUpdate"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " was installed successfully"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    iget-boolean v6, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsLog:Z

    invoke-static {v4, v5, v6}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 319
    const v4, 0x7f07006f

    invoke-virtual {p0, v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v4

    new-array v5, v8, [Ljava/lang/Object;

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v7

    invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-static {p0, v4}, Lcom/nemustech/regina/RUtils;->showToast(Landroid/content/Context;Ljava/lang/String;)Landroid/widget/Toast;

    goto :goto_1

    .line 328
    :cond_1
    const-string v4, "ReginaCheckForUpdate"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " was not updated"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    iget-boolean v6, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsLog:Z

    invoke-static {v4, v5, v6}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 329
    const v4, 0x7f07006e

    invoke-virtual {p0, v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v4

    new-array v5, v8, [Ljava/lang/Object;

    invoke-virtual {v2}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v6

    aput-object v6, v5, v7

    invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-static {p0, v4}, Lcom/nemustech/regina/RUtils;->showToast(Landroid/content/Context;Ljava/lang/String;)Landroid/widget/Toast;

    goto :goto_2

    .line 333
    .end local v0           #currentVersionCode:I
    .end local v2           #record:Lcom/nemustech/regina/XMLRecord;
    .end local v3           #serverVersionCode:I
    :cond_2
    iget-object v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mListAdapter:Lcom/nemustech/regina/XMLRecordAdapter;

    invoke-virtual {v4}, Lcom/nemustech/regina/XMLRecordAdapter;->notifyDataSetChanged()V

    .line 334
    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getAvailableUpdateItem()I

    move-result v4

    invoke-virtual {p0, v4}, Lcom/nemustech/regina/ReginaCheckForUpdate;->setStatus(I)V

    .line 335
    iput-boolean v7, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsTarget:Z

    .line 338
    .end local v1           #i:I
    :cond_3
    return-void

    .line 316
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
    .end packed-switch
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 4
    .parameter "savedInstanceState"

    .prologue
    const/4 v3, 0x0

    .line 189
    invoke-super {p0, p1}, Landroid/app/ListActivity;->onCreate(Landroid/os/Bundle;)V

    .line 190
    const/high16 v2, 0x7f03

    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->setContentView(I)V

    .line 191
    const v2, 0x7f07005b

    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->setTitle(Ljava/lang/CharSequence;)V

    .line 193
    const v2, 0x7f090003

    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/Button;

    .line 194
    .local v1, updateAll:Landroid/widget/Button;
    iget-object v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->updateAllListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 198
    const v2, 0x7f070001

    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0, v2, v3}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 199
    .local v0, sharedPref:Landroid/content/SharedPreferences;
    const-string v2, "regina.launcher.modev"

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v2

    iput-boolean v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mDeveloperMode:Z

    .line 202
    iget-boolean v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mDeveloperMode:Z

    if-nez v2, :cond_0

    .line 203
    const/16 v2, 0x8

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setVisibility(I)V

    .line 207
    :cond_0
    iput-boolean v3, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsTarget:Z

    .line 208
    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->readServerXML()V

    .line 209
    return-void
.end method

.method protected onListItemClick(Landroid/widget/ListView;Landroid/view/View;IJ)V
    .locals 6
    .parameter "l"
    .parameter "v"
    .parameter "position"
    .parameter "id"

    .prologue
    const/4 v5, 0x1

    .line 282
    iput p3, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mSelectedPostion:I

    .line 283
    iget v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mSelectedPostion:I

    invoke-virtual {p1, v2}, Landroid/widget/ListView;->getItemAtPosition(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/nemustech/regina/XMLRecord;

    .line 285
    .local v1, record:Lcom/nemustech/regina/XMLRecord;
    iget-boolean v2, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mDeveloperMode:Z

    if-eqz v2, :cond_0

    .line 286
    const-string v2, "ReginaCheckForUpdate"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " will be updated"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    iget-boolean v4, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsLog:Z

    invoke-static {v2, v3, v4}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 287
    invoke-virtual {v1, v5}, Lcom/nemustech/regina/XMLRecord;->setTargeted(Z)V

    .line 288
    iput-boolean v5, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mIsTarget:Z

    .line 289
    new-instance v0, Landroid/content/Intent;

    const-class v2, Lcom/nemustech/regina/ReginaUpdater;

    invoke-direct {v0, p0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 290
    .local v0, intent:Landroid/content/Intent;
    const-string v2, "XMLRECORD"

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;

    .line 291
    const/4 v2, 0x0

    invoke-virtual {p0, v0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->startActivityForResult(Landroid/content/Intent;I)V

    .line 301
    :goto_0
    return-void

    .line 294
    .end local v0           #intent:Landroid/content/Intent;
    :cond_0
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v0, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 295
    .restart local v0       #intent:Landroid/content/Intent;
    const/high16 v2, 0x1000

    invoke-virtual {v0, v2}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    .line 296
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "market://details?id="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v1}, Lcom/nemustech/regina/XMLRecord;->getPackageName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 298
    invoke-virtual {p0, v0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->startActivity(Landroid/content/Intent;)V

    goto :goto_0
.end method

.method protected onPause()V
    .locals 1

    .prologue
    .line 214
    iget-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mNetworkInfoReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 215
    iget-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mCancelReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 216
    iget-object v0, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mAppUpdatedReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 217
    invoke-super {p0}, Landroid/app/ListActivity;->onPause()V

    .line 218
    return-void
.end method

.method protected onResume()V
    .locals 4

    .prologue
    .line 223
    iget-object v1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mNetworkInfoReceiver:Landroid/content/BroadcastReceiver;

    new-instance v2, Landroid/content/IntentFilter;

    const-string v3, "android.net.conn.CONNECTIVITY_CHANGE"

    invoke-direct {v2, v3}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v1, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 224
    iget-object v1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mCancelReceiver:Landroid/content/BroadcastReceiver;

    new-instance v2, Landroid/content/IntentFilter;

    const-string v3, "ACTION_REGINA_UPDATER_CANCEL"

    invoke-direct {v2, v3}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v1, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 225
    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    .line 226
    .local v0, filter:Landroid/content/IntentFilter;
    const-string v1, "android.intent.action.PACKAGE_ADDED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 227
    const-string v1, "android.intent.action.PACKAGE_CHANGED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 228
    const-string v1, "package"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addDataScheme(Ljava/lang/String;)V

    .line 229
    iget-object v1, p0, Lcom/nemustech/regina/ReginaCheckForUpdate;->mAppUpdatedReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v1, v0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 230
    invoke-super {p0}, Landroid/app/ListActivity;->onResume()V

    .line 231
    return-void
.end method

.method public readServerXML()V
    .locals 1

    .prologue
    .line 342
    new-instance v0, Lcom/nemustech/regina/ReginaCheckForUpdate$6;

    invoke-direct {v0, p0}, Lcom/nemustech/regina/ReginaCheckForUpdate$6;-><init>(Lcom/nemustech/regina/ReginaCheckForUpdate;)V

    invoke-virtual {v0}, Lcom/nemustech/regina/ReginaCheckForUpdate$6;->start()V

    .line 421
    return-void
.end method

.method public setStatus(I)V
    .locals 7
    .parameter "count"

    .prologue
    const/4 v6, 0x0

    const/4 v5, 0x1

    .line 424
    const v2, 0x7f090002

    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 425
    .local v0, tv:Landroid/widget/TextView;
    const v2, 0x7f090003

    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/Button;

    .line 426
    .local v1, updateAll:Landroid/widget/Button;
    packed-switch p1, :pswitch_data_0

    .line 432
    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getAvailableUpdateItem()I

    move-result v2

    if-ne v2, v5, :cond_0

    const v2, 0x7f070062

    :goto_0
    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v2

    new-array v3, v5, [Ljava/lang/Object;

    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getAvailableUpdateItem()I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v3, v6

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 433
    invoke-virtual {v1, v5}, Landroid/widget/Button;->setEnabled(Z)V

    .line 436
    :goto_1
    return-void

    .line 428
    :pswitch_0
    const v2, 0x7f070064

    invoke-virtual {p0, v2}, Lcom/nemustech/regina/ReginaCheckForUpdate;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 429
    invoke-virtual {v1, v6}, Landroid/widget/Button;->setEnabled(Z)V

    goto :goto_1

    .line 432
    :cond_0
    const v2, 0x7f070063

    goto :goto_0

    .line 426
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
    .end packed-switch
.end method
